
#ifndef _HC595_HPP
#define _HC595_HPP

#include "stm8l15x.h"
volatile extern u8 cIoState;
void refresh_595(void);

typedef struct
{
  u8 Bit0:1;
  u8 Bit1:1;
  u8 Bit2:1;
  u8 Bit3:1;
  u8 Bit4:1;
  u8 Bit5:1;
  u8 Bit6:1;
  u8 Bit7:1;
} strBit81;

#define	  Lamp_Turn_ON(n)			{n =1;}
#define   Lamp_turn_OFF(n)		{n =0;}
#define		Bklt_Turn_ON(n)     {n =0;}
#define		Bklt_Turn_OFF(n)    {n =1;}
 
#define		 output595  {cIoState = n; refresh_595();}

 
 #define 	pin_JD_LED		(*((strBit81 *)&cIoState)).Bit0  
 #define	 pin_Bklt_Out		(*((strBit81 *)&cIoState)).Bit1  
  
#define		pin_ESAM_Rst     (*((strBit81 *)&cIoState)).Bit4  
#define 	pin_IC_Pwr 				(*((strBit81 *)&cIoState)).Bit5  
#define		 pin_MD_EVT			(*((strBit81 *)&cIoState)).Bit6
#define		 pin_Alm_LED		(*((strBit81 *)&cIoState)).Bit7

#define  pin_Alm_LED_CR1   ////
#define  pin_Alm_LED_DDR   ////
#define 	pin_Alm_LED_IN   ////
#define  pin_Alm_LED_CR1   ////
#endif
